package com.date.Demo;
//将类改为public，实现不同包之前的访问
public class Date3{
    public int year;
    public int month;
    public int day;
    public void printDate(){
        System.out.println(year+"年 "+month+" 月"+day+" 日");
    }

    public void setDate(int year,int month,int day ){
        this.year=year;
        this.month=month;
        this.day=day;
    }
    public Date3(int year,int month,int day ){
        this.year=year;
        this.month=month;
        this.day=day;
        System.out.println("调用了带有三个参数的构造方法");
    }
}
